package com.zhentao.controller;

import com.zhentao.dto.HistorySearchDto;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.ApUserSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/v1/history")
public class ApUserSearchController {
    @Autowired
    private ApUserSearchService apUserSearchService;

    @PostMapping("/load")
    public ResponseResult load() {
        return apUserSearchService.findUserSearch("4");
    }

    @PostMapping("/del")
    public ResponseResult del(@RequestBody HistorySearchDto dto) {
        return apUserSearchService.deleteById(dto);
    }
}